import 'osc_notice.dart';

class OscFavoriteListEntity {
	List<OscFavorite> favoriteList;
	OscNotice notice;

	OscFavoriteListEntity({this.favoriteList, this.notice});

	OscFavoriteListEntity.fromJson(Map<String, dynamic> json) {
		if (json['favoriteList'] != null) {
			favoriteList = new List<OscFavorite>();(json['favoriteList'] as List).forEach((v) { favoriteList.add(new OscFavorite.fromJson(v)); });
		}
		notice = json['notice'] != null ? new OscNotice.fromJson(json['notice']) : null;
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.favoriteList != null) {
      data['favoriteList'] =  this.favoriteList.map((v) => v.toJson()).toList();
    }
		if (this.notice != null) {
      data['notice'] = this.notice.toJson();
    }
		return data;
	}
}

class OscFavorite {
	int objId;//对应对象ID
	String title;//标题
	int type;//0-全部|1-软件|2-话题|3-博客|4-新闻|5代码|7-翻译
	String url;//对应的url

	OscFavorite({this.objId, this.title, this.type, this.url});

	OscFavorite.fromJson(Map<String, dynamic> json) {
		objId = json['objid'];
		title = json['title'];
		type = json['type'];
		url = json['url'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['objid'] = this.objId;
		data['title'] = this.title;
		data['type'] = this.type;
		data['url'] = this.url;
		return data;
	}
}
